<template>
  <div class="indexnew">
    <div class="indexnew_box" style="padding-bottom: 5px">
      <one :data="one"></one>
    </div>

    <div class="indexnew_box" style="border-radius: 5px">
      <two :data="two"></two>
    </div>
    <div class="indexnew_box" style="padding-bottom: 10px">
      <three :data="three" :three1="three1"></three>
    </div>
  </div>
</template>
<script>
import one from "@/components/index/components/one_v2";
import two from "@/components/index/components/two_v2";
import three from "@/components/index/components/three_v2";
export default {
  name: "index2",
  data() {
    return {
      one: {},
      two: {},
      three: [],
      three1: {},
    };
  },
  components: {
    one,
    two,
    three,
  },
  beforeDestroy() {
    this.$bus.$off("refresh");
  },
  created() {
    this.getData();
    this.$bus.$on("refresh", (type) => {
      this.refresh(type);
    });
  },
  methods: {
    refresh() {
      this.getData();
    },
    getData() {
      this.$api.getIndex.getIndexNew({}).then((res) => {
        if (res.data.code == 200) {
          this.one = res.data.result.mail;
          this.two = res.data.result.funds;
          this.three = res.data.result.made;
          this.three1 = res.data.result.pending;
        } else {
          this.$fnc.alertError(res.data.result);
        }
      });
    },
  },
};
</script>
<style lang="less" scoped>
.indexnew {
  width: 100%;
  height: 100%;
  background-color: #f5f7f9;
  overflow: auto;

  padding: 20px 20px 20px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  color: #111111;

  .indexnew_box {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-bottom: 25px;
  }
  .index_part {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 25px;
  }

  .indexhelp_box {
    height: auto !important;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-bottom: 15px;
  }
}
</style>
